]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
boxPointer: Rename show/hide to open/close
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 21 Aug 2018 10:29:44 +0000 (07:29 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 9 Oct 2018 01:42:53 +0000 (22:42 -0300)
Pretty much like dd4709bb2, BoxPointer's show() and hide()
functions will clash with Clutter.Actor's ones.

In addition to that, on a conceptual level, the current API
is not great, because calling boxPointer.hide() won't result
in boxPointer.actor.visible == false.

For these reasons, rename show() and hide() to open() and
close(). A compatibility layer will be added in a following
commit, warning about the usage of show() and hide().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153

js/ui/appDisplay.js
js/ui/boxpointer.js
js/ui/ibusCandidatePopup.js
js/ui/keyboard.js
js/ui/popupMenu.js
js/ui/workspaceThumbnail.js

index 6f67127c485d89365931312f5246f9ef66626857..2162292aac3323248d7d3fdaf26ad0985fac6072 100644 (file)
@@ -1535,7 +1535,7 @@ var AppFolderPopup = new Lang.Class({
         // is completed so we can animate the icons after as we like without
         // showing them while boxpointer is animating.
         this._view.actor.opacity = 0;
-        this._boxPointer.show(BoxPointer.PopupAnimation.FADE |
+        this._boxPointer.open(BoxPointer.PopupAnimation.FADE |
                               BoxPointer.PopupAnimation.SLIDE,
                               () => {
                 this._view.actor.opacity = 255;
@@ -1551,8 +1551,8 @@ var AppFolderPopup = new Lang.Class({
 
         this._grabHelper.ungrab({ actor: this.actor });
 
-        this._boxPointer.hide(BoxPointer.PopupAnimation.FADE |
-                              BoxPointer.PopupAnimation.SLIDE);
+        this._boxPointer.close(BoxPointer.PopupAnimation.FADE |
+                               BoxPointer.PopupAnimation.SLIDE);
         this._isOpen = false;
         this.emit('open-state-changed', false);
     },
index d51877d18035bf3b56f1acd27b0f0fd407c70389..acb1487b615789a67cdd6e0048bcd252801da851 100644 (file)
@@ -80,7 +80,7 @@ var BoxPointer = new Lang.Class({
         }
     },
 
-    show(animate, onComplete) {
+    open(animate, onComplete) {
         let themeNode = this.actor.get_theme_node();
         let rise = themeNode.get_length('-arrow-rise');
         let animationTime = (animate & PopupAnimation.FULL) ? POPUP_ANIMATION_TIME : 0;
@@ -121,7 +121,7 @@ var BoxPointer = new Lang.Class({
                                  time: animationTime });
     },
 
-    hide(animate, onComplete) {
+    close(animate, onComplete) {
         if (!this.actor.visible)
             return;
 
index 786799bf95b295c5d7b980abde0ceef97a96b228..af2c777d3e92b2bc4636602f97bb4c994cc7cd7d 100644 (file)
@@ -272,7 +272,7 @@ var CandidatePopup = new Lang.Class({
             this._updateVisibility();
         });
         panelService.connect('focus-out', ps => {
-            this._boxPointer.hide(BoxPointer.PopupAnimation.NONE);
+            this._boxPointer.close(BoxPointer.PopupAnimation.NONE);
             Main.keyboard.resetSuggestions();
         });
     },
@@ -291,10 +291,10 @@ var CandidatePopup = new Lang.Class({
 
         if (isVisible) {
             this._boxPointer.setPosition(Main.layoutManager.dummyCursor, 0);
-            this._boxPointer.show(BoxPointer.PopupAnimation.NONE);
+            this._boxPointer.open(BoxPointer.PopupAnimation.NONE);
             this._boxPointer.actor.raise_top();
         } else {
-            this._boxPointer.hide(BoxPointer.PopupAnimation.NONE);
+            this._boxPointer.close(BoxPointer.PopupAnimation.NONE);
         }
     },
 
index 491495c57dff6d6975ee95dbed4d15044b7709a7..6104ab779436532431139d2de7eb5239c48c3d56 100644 (file)
@@ -356,7 +356,7 @@ var Key = new Lang.Class({
     },
 
     _showSubkeys() {
-        this._boxPointer.show(BoxPointer.PopupAnimation.FULL);
+        this._boxPointer.open(BoxPointer.PopupAnimation.FULL);
         this._capturedEventId = global.stage.connect('captured-event',
                                                      this._onCapturedEvent.bind(this));
         this._unmapId = this.keyButton.connect('notify::mapped', () => {
@@ -367,7 +367,7 @@ var Key = new Lang.Class({
 
     _hideSubkeys() {
         if (this._boxPointer)
-            this._boxPointer.hide(BoxPointer.PopupAnimation.FULL);
+            this._boxPointer.close(BoxPointer.PopupAnimation.FULL);
         if (this._capturedEventId) {
             global.stage.disconnect(this._capturedEventId);
             this._capturedEventId = 0;
index f449d6e7e994c481db056685000d8283c1955e88..41455a202875f172045e39b50f5995f9da419c13 100644 (file)
@@ -873,7 +873,7 @@ var PopupMenu = new Lang.Class({
         this.isOpen = true;
 
         this._boxPointer.setPosition(this.sourceActor, this._arrowAlignment);
-        this._boxPointer.show(animate);
+        this._boxPointer.open(animate);
 
         this.actor.raise_top();
 
@@ -885,7 +885,7 @@ var PopupMenu = new Lang.Class({
             this._activeMenuItem.setActive(false);
 
         if (this._boxPointer.actor.visible) {
-            this._boxPointer.hide(animate, () => {
+            this._boxPointer.close(animate, () => {
                 this.emit('menu-closed');
             });
         }
index b8d1faeb63864d4095086124a6ccd1f200d082ba..0aa27cb8a49de0bf2e05e472c143b92245bd04be 100644 (file)
@@ -1142,8 +1142,6 @@ var ThumbnailsBox = new Lang.Class({
         let workspaceManager = global.workspace_manager;
         let themeNode = this.get_theme_node();
 
-        forWidth = themeNode.adjust_for_width(forWidth);
-
         let spacing = themeNode.get_length('spacing');
         let nWorkspaces = workspaceManager.n_workspaces;
         let totalSpacing = (nWorkspaces - 1) * spacing;